package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TBuyerGoodsMapper;
import com.ruoyi.system.domain.TBuyerGoods;
import com.ruoyi.system.service.ITBuyerGoodsService;

/**
 * 商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-29
 */
@Service
public class TBuyerGoodsServiceImpl implements ITBuyerGoodsService 
{
    @Autowired
    private TBuyerGoodsMapper tBuyerGoodsMapper;

    /**
     * 查询商品
     * 
     * @param goodsId 商品主键
     * @return 商品
     */
    @Override
    public TBuyerGoods selectTBuyerGoodsByGoodsId(String goodsId)
    {
        return tBuyerGoodsMapper.selectTBuyerGoodsByGoodsId(goodsId);
    }

    /**
     * 查询商品列表
     * 
     * @param tBuyerGoods 商品
     * @return 商品
     */
    @Override
    public List<TBuyerGoods> selectTBuyerGoodsList(TBuyerGoods tBuyerGoods)
    {
        return tBuyerGoodsMapper.selectTBuyerGoodsList(tBuyerGoods);
    }

    /**
     * 新增商品
     * 
     * @param tBuyerGoods 商品
     * @return 结果
     */
    @Override
    public int insertTBuyerGoods(TBuyerGoods tBuyerGoods)
    {
        tBuyerGoods.setCreateTime(DateUtils.getNowDate());
        return tBuyerGoodsMapper.insertTBuyerGoods(tBuyerGoods);
    }

    /**
     * 修改商品
     * 
     * @param tBuyerGoods 商品
     * @return 结果
     */
    @Override
    public int updateTBuyerGoods(TBuyerGoods tBuyerGoods)
    {
        tBuyerGoods.setUpdateTime(DateUtils.getNowDate());
        return tBuyerGoodsMapper.updateTBuyerGoods(tBuyerGoods);
    }

    /**
     * 批量删除商品
     * 
     * @param goodsIds 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deleteTBuyerGoodsByGoodsIds(String[] goodsIds)
    {
        return tBuyerGoodsMapper.deleteTBuyerGoodsByGoodsIds(goodsIds);
    }

    /**
     * 删除商品信息
     * 
     * @param goodsId 商品主键
     * @return 结果
     */
    @Override
    public int deleteTBuyerGoodsByGoodsId(String goodsId)
    {
        return tBuyerGoodsMapper.deleteTBuyerGoodsByGoodsId(goodsId);
    }
}
